package com.mangowang.module.main.adapter;

import android.content.Context;
import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.mangowang.lib.common.proto.Recharge;
import com.mangowang.module.main.R;
import com.ruffian.library.widget.RView;

import org.jetbrains.annotations.NotNull;

import java.util.List;

public class AccountTwoAdapter extends BaseQuickAdapter<Recharge.wallet_detail, BaseViewHolder> {
    private final int[] colors ={
         R.color.ared,
         R.color.ayellow,
         R.color.ablue,
         R.color.agreen,
         R.color.aqing,
         R.color.alan,
         R.color.aorange
    };

    private final String[] colorStrings = {
            "#FFFE3132","#FFFDC002","#FF2E77E7","#FF0AA711","#FF01FCF8","#FF0100F5","#FFFB9028"
    };



    public AccountTwoAdapter(Context context, List<Recharge.wallet_detail> dataList) {
        super(R.layout.account_two_item, dataList);
    }


    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, Recharge.wallet_detail bean) {
        baseViewHolder.setText(R.id.tv_money,bean.getAmount())
                .setText(R.id.tv_title,bean.getTitle());
       RView view = baseViewHolder.getView(R.id.v_color);
       view.getHelper().setBackgroundColorNormal(Color.parseColor(colorStrings[baseViewHolder.getAdapterPosition()]));
    }
}
